package org.millioncall.yueyoga.admin.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.dao.entity.ClassEntity;
import org.millioncall.yueyoga.admin.model.AviatorExpression;
import org.millioncall.yueyoga.admin.model.Chedule;
import org.millioncall.yueyoga.admin.model.ClassMemberModel;
import org.millioncall.yueyoga.admin.model.ClassProduct;
import org.millioncall.yueyoga.admin.model.ClassRecord;
import org.millioncall.yueyoga.admin.model.ClassScheduleModel;
import org.millioncall.yueyoga.admin.model.Clazz;
import org.millioncall.yueyoga.admin.model.TinyClass;

public interface ClazzService {
	int deleteByPrimaryKey(Integer id);

	int insert(Clazz record);

	int insertSelective(Clazz record);

	Clazz selectByPrimaryKey(Integer id);

	public List<TinyClass> findAllClassTiny(Map<String, Object> map);

	int updateByPrimaryKeySelective(Clazz record);

	int updateByPrimaryKeyWithBLOBs(Clazz record);

	int updateByPrimaryKey(Clazz record);

	public PaginatedList<ClassRecord> findClazzPage(Integer start,
			Integer limit, Map<String, Object> map);

	public List<Chedule> findScheduleExportPage(Map<String, Object> map);

	public Clazz findById(Map<String, Object> map);

	public ClassEntity findByClassId(Map<String, Object> map);

	public int deleteClazzByIds(List<Integer> Ids);

	public String findClassCode();

	public boolean saveClassSaveEntity(ClassEntity entity);

	public boolean updateClassEntity(ClassEntity entity);

	public boolean addMemberToClass(Integer classId, Integer memberId,
			String createdBy);

	public boolean addProductToClass(Integer classId, Integer productId,
			String productName, String createdBy);

	// 班级是否已包含会员
	public boolean containsMember(Integer classId, Integer memberId);

	public boolean containsProduct(Integer classId, Integer productId);

	/**
	 * 根据班级编号查询班级成员，前提是该班级是固定会员类型
	 * 
	 * @param classId
	 * @return
	 */
	public PaginatedList<ClassMemberModel> findClassMembersByClassId(Map<String, Object> map, int start, int limit);

	/**
	 * 删除班级中的会员
	 * 
	 * @param classId
	 * @param memberIds
	 * @return
	 */
	public boolean deleteMemberOfClass(Integer classId, List<Integer> memberIds);

	public boolean deleteProductOfClass(Integer classId, List<Integer> productIds);

	public List<ClassProduct> findClassProduct(Map<String, Object> map);

	/**
	 * 获取班级课程表
	 * @return
	 */
	public List<ClassScheduleModel> findClassScheduleList(
			Date curDate, String clsId);
	
	/** 高级搜索班级 */
	public List<ClassRecord> getAllClazzWithAviator(Map<String, Object> params,
			AviatorExpression expression, Map<String, Object> aviatorParams,
			int limit);
}